package com.zhuangjie.shop.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.zhuangjie.shop.pojo.DishStatisticsInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 菜品表
 * </p>
 *
 * @author zhuangjie
 * @since 2023-09-24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dish")
@ApiModel(value = "Dish对象", description = "菜品表")
public class Dish implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "商品id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;


    @ApiModelProperty(value = "商品分类_分类id")
    @TableField("dish_category_id")
    private Long dishCategoryId;

    @ApiModelProperty(value = "商家/商店_店铺id")
    @TableField("shop_id")
    private Long shopId;

    @ApiModelProperty(value = "商品名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "商品样品图片")
    @TableField("image")
    private String image;

    @ApiModelProperty(value = "标签项(多个标签用逗号隔开)")
    @TableField("labels")
    private String labels;

    @ApiModelProperty(value = "商品描述")
    @TableField("`describe`")
    private String describe;

    @ApiModelProperty(value = "商品原价")
    @TableField("old_price")
    private BigDecimal oldPrice;

    @ApiModelProperty(value = "商品现价")
    @TableField("now_price")
    private BigDecimal nowPrice;

    @ApiModelProperty(value = "卖出数量")
    @TableField("sell_number")
    private Long sellNumber;

    @ApiModelProperty(value = "是否优先展示（1优先展示，0普通展示）")
    @TableField("better_display")
    private Integer betterDisplay;

    @ApiModelProperty(value = "商品状态（0停售，1启售）")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除
     */
    @ApiModelProperty(value = "逻辑删除")
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @TableLogic
    private Integer deleted;

    @ApiModelProperty(value = "菜品的口味")
    @TableField(exist = false)
    private List<DishFlavor> dishFlavorList;

    @ApiModelProperty(value = "菜品评分信息")
    @TableField(exist = false)
    private DishStatisticsInfo statisticsInfo;
}
